Skip to content

fix: restore system bar insets so FB header is tappable - #19

Merged
mretallack merged 2 commits into
mainfrom
fix/edge-to-edge-status-bar
Oct 16, 2026
Merged

mretallack merged 2 commits into
mainfrom
fix/edge-to-edge-status-bar

Conversation

@mretallack

Copy link
Copy Markdown
Owner

Problem

Since a804357 raised compileSdk/targetSdk from 34 to 35 (2026-10-11), Android 15 forces edge-to-edge: the WebView is drawn underneath the status bar, and the system bar swallows touches in that band.

Symptom: Facebook's own header back arrow and search icon are visible but untappable. Taps land on the status bar rather than the WebView.

The app had no inset handling at all — no fitsSystemWindows, no WindowInsets code, no JS top-padding — so it relied entirely on the implicit inset that API 35 removed.

Fix

Opt out of edge-to-edge enforcement in themes.xml to restore the pre-API-35 behaviour of giving the system bars their own space.

Caveat — this is a stopgap

android:windowOptOutEdgeToEdgeEnforcement is deprecated and is only honoured up to targetSdk 35. It will be ignored in a future Android release, so it buys time rather than solving the problem.

The real fix is explicit inset handling:

  • android:fitsSystemWindows="true" on the root FrameLayout, or
  • ViewCompat.setOnApplyWindowInsetsListener applying systemBars() insets,

with statsBadge and messengerButton kept inside the inset-safe area — otherwise the overlays end up under the status bar instead, which is the same class of bug as issue #9.

A TODO in themes.xml records this.

Testing

Verified on a physical moto g52 (Android 15) after adb install -r:

  • FB header now sits below the status bar
  • header back arrow is tappable
  • search icon is tappable
  • overlays (statsBadge, Messenger button) still positioned correctly — needs a check on a build that has the Messenger button

Built and verified the attribute is present in the APK: Style/Theme.SlimBook item 0x0101069a = true.

Raising targetSdk to 35 (a804357) made Android 15 force edge-to-edge, so the
WebView was drawn underneath the status bar and the system bar swallowed
touches in that band. Facebook's own header back arrow and search icon stayed
visible but became untappable.

Opt out of edge-to-edge enforcement to restore the pre-API-35 behaviour of
giving the system bars their own space. This attribute is deprecated and is
only honoured up to targetSdk 35, so it is a stopgap: the real fix is explicit
inset handling (fitsSystemWindows on the root FrameLayout, or
ViewCompat.setOnApplyWindowInsetsListener applying systemBars() insets) with
statsBadge and messengerButton kept inside the inset-safe area.

Verified on device (moto g52): back arrow and search icon are tappable again.
Lint failed with NewApi: the attribute requires API level 35 while minSdk is 26.
Move it into values-v35/ so it only applies where edge-to-edge enforcement
exists; API 26-34 never forced edge-to-edge and keep the base theme unchanged.

Fixes the lint error introduced by the previous commit.
@mretallack
mretallack merged commit c59c925 into main Oct 16, 2026
4 checks passed
mretallack added a commit that referenced this pull request Oct 16, 2026
Patch release fixing a regression introduced by the targetSdk 34 -> 35 bump in
1.2.0: Android 15 forced edge-to-edge, so the WebView was drawn underneath the
status bar and Facebook's own header back arrow and search icon became visible
but untappable (PR #19).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant